//
//  MKRequest.h
//  yangtuner
//
//  Created by zhuwh on 2017/4/9.
//  Copyright © 2017年 maikevip. All rights reserved.
//

#import <YTKNetwork/YTKNetwork.h>
@class MAKResponse;

typedef BOOL (^MAKResponseSuccessBlock)(__kindof id response );
typedef void (^MAKResponseFailureBlock)(__kindof NSError* error );

@interface MAKRequest : YTKRequest

-(BOOL)mak_needRefreshToken;

-(void)mak_refreshTokenCallBack:(id)response;

-(void)mak_startWithCompletionBlockWithSuccess:(MAKResponseSuccessBlock)success blockFailure:(MAKResponseFailureBlock)failure;

@property(nonatomic,assign,readonly)MAKRequest* mak_refreshTokenRequest; //返回刷新token api
@property(nonatomic,assign,readonly)Class mak_responseClass; //返回数据类型
@property(nonatomic,assign,readonly)Class mak_modelClass; //返回的元数据类型


/**
 自定义解析器响应参数
 
 @param jsonResponse json响应
 @return 解析后的JSON
 */
- (id)mak_reformJSONResponse:(id)jsonResponse;

- (BOOL)mak_handleError:(NSError*)error;
@end
